//
//  NSString+WMUtils.h
//  WholeMusic
//
//  Created by quanxiong on 2018/2/24.
//  Copyright © 2018年 quanxiong. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef struct {
    __unsafe_unretained NSString *escapeSequence;
    unichar uchar;
} HTMLEscapeMap;


@interface NSString (WMUtils)

- (NSString *)wm_stringByConvertingHTMLToPlainText;
- (NSString *)wm_stringByDecodingHTMLEntities;
- (NSString *)wm_stringByEncodingHTMLEntities;
- (NSString *)wm_stringByEncodingHTMLEntities:(BOOL)isUnicode;
- (NSString *)wm_stringWithNewLinesAsBRs;
- (NSString *)wm_stringByRemovingNewLinesAndWhitespace;
- (NSString *)wm_stringByLinkifyingURLs;
- (NSString *)wm_stringByStrippingTags;

- (NSString *)gtm_stringByEscapingHTMLUsingTable:(HTMLEscapeMap*)table
                                          ofSize:(NSUInteger)size
                                 escapingUnicode:(BOOL)escapeUnicode;
- (NSString *)gtm_stringByEscapingForHTML;
- (NSString *)gtm_stringByEscapingForAsciiHTML;
- (NSString *)gtm_stringByUnescapingFromHTML;

@end
